<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

<ui:composition template="/templates/template.xhtml">
	<ui:define name="body">
		<h:form id="formBuildActivity">

			<a4j:keepAlive beanName="buildActivityDetailsBean"/>

			<rich:panel>
				<f:facet name="header">
					<h:outputText
							value="#{msg.PANEL_HEADER_ACTIVITY_DETAILS}"/>
				</f:facet>

				<h:panelGrid columns="2" columnClasses="activityDetailsColumnLeft,activityDetailsColumnRight"
				             styleClass="activityDetailsTable">
					<rich:panel styleClass="activityPanelDetails-#{buildActivityDetailsBean.activity.result}">
						<f:facet name="header">
							<h:outputText value="#{msg.ACTIVITY}"/>
						</f:facet>
						<h:panelGrid columns="2" columnClasses="columnLabel,columnValue">
							<h:outputText value="#{msg.PLAN_NAME}"/>
							<h:outputText value="#{buildActivityDetailsBean.activity.buildDefinition.name}"/>

							<h:outputText value="#{msg.ACTIVITY}"/>
							<h:outputText
									value="#{buildActivityDetailsBean.activity.buildDefinition.name}-#{buildActivityDetailsBean.activity.buildNumber}"/>

							<h:outputText value="#{msg.START_TIME}"/>
							<h:outputText value="#{buildActivityDetailsBean.activity.started}"/>

							<h:outputText value="#{msg.END_TIME}"/>
							<h:outputText value="#{buildActivityDetailsBean.activity.ended}"/>

							<h:outputText value="#{msg.DURATION}"/>
							<h:outputText value="#{buildActivityDetailsBean.activity.duration}"/>

							<h:outputText value="#{msg.STATUS}"/>
							<h:outputText value="#{buildActivityDetailsBean.activity.result}"/>
						</h:panelGrid>
					</rich:panel>

					<rich:panel styleClass="changesPanel">
						<f:facet name="header">
							<h:outputText value="#{msg.PANEL_HEADER_ACTIVITY_CHANGES}"/>
						</f:facet>

						<h:outputText value="#{msg.NO_CHANGES}"
						              rendered="#{empty buildActivityDetailsBean.activity.commits}"/>

						<rich:dataTable value="#{buildActivityDetailsBean.activity.commits}" var="commit"
						                rendered="#{not empty buildActivityDetailsBean.activity.commits}">
							<rich:column>
								<f:facet name="header">
									<h:outputText value="#{msg.AUTHOR}"/>
								</f:facet>
								<h:outputText value="#{commit.author}"/>
							</rich:column>
							<rich:column>
								<f:facet name="header">
									<h:outputText value="#{msg.DATE}"/>
								</f:facet>
								<h:outputText value="#{commit.date}"/>
							</rich:column>
							<rich:column>
								<f:facet name="header">
									<h:outputText value="#{msg.COMMENT}"/>
								</f:facet>
								<h:outputText value="#{commit.comment}"/>
							</rich:column>
							<rich:column>
								<f:facet name="header">
									<h:outputText value="#{msg.CHANGE}"/>
								</f:facet>
								<h:outputText value="#{commit.changes}"/>
							</rich:column>
						</rich:dataTable>
					</rich:panel>
				</h:panelGrid>

				<rich:spacer height="30"/>

				<rich:simpleTogglePanel opened="false" switchType="ajax">
					<f:facet name="header">
						<h:outputText value="#{msg.PANEL_HEADER_ACTIVITY_LOGS}"/>
					</f:facet>
					<h:inputTextarea readonly="true" value="#{buildActivityDetailsBean.activity.buildLog}" rows="20"
					                 cols="180"/>
				</rich:simpleTogglePanel>

			</rich:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>